import { axios } from '@/utils/request'

/**
 * 查询分类
 *
 * @author Johnnie Wind
 * @date 2021-10-06 21:35:38
 */
export function categoryPage (parameter) {
  return axios({
    url: '/category/page',
    method: 'get',
    params: parameter
  })
}

/**
 * 分类列表
 *
 * @author Johnnie Wind
 * @date 2021-10-06 21:35:38
 */
export function categoryList (parameter) {
  return axios({
    url: '/category/list',
    method: 'get',
    params: parameter
  })
}

/**
 * 添加分类
 *
 * @author Johnnie Wind
 * @date 2021-10-06 21:35:38
 */
export function categoryAdd (parameter) {
  return axios({
    url: '/category/add',
    method: 'post',
    data: parameter
  })
}

/**
 * 编辑分类
 *
 * @author Johnnie Wind
 * @date 2021-10-06 21:35:38
 */
export function categoryEdit (parameter) {
  return axios({
    url: '/category/edit',
    method: 'post',
    data: parameter
  })
}

/**
 * 删除分类
 *
 * @author Johnnie Wind
 * @date 2021-10-06 21:35:38
 */
export function categoryDelete (parameter) {
  return axios({
    url: '/category/delete',
    method: 'post',
    data: parameter
  })
}

/**
 * 导出分类
 *
 * @author Johnnie Wind
 * @date 2021-10-06 21:35:38
 */
export function categoryExport (parameter) {
  return axios({
    url: '/category/export',
    method: 'get',
    params: parameter,
    responseType: 'blob'
  })
}
